//
//  PKPlayListTableViewCell.m
//  PianKe
//
//  Created by lanou on 15/10/6.
//  Copyright (c) 2015年 lanou. All rights reserved.
//

#import "PKPlayListTableViewCell.h"

@implementation PKPlayListTableViewCell


-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self=[super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        _leftView=[[UIView alloc]initWithFrame:CGRectMake(0, 0, 5, 60)];
        _titleLabel=[[UILabel alloc]initWithFrame:CGRectMake(10, 5, 200, 20)];
        _usernameLabel=[[UILabel alloc]initWithFrame:CGRectMake(10, 30, 200, 20)];
        _downLoadButton=[UIButton buttonWithType:UIButtonTypeCustom];
        _downLoadButton.frame=CGRectMake(SCREEN_WIDTH-30, 20, 20, 20);
        [_downLoadButton setImage:[UIImage imageNamed:@"downloadimg"] forState:UIControlStateNormal];
        [self.contentView addSubview:_leftView];
        [self.contentView addSubview:_titleLabel];
        [self.contentView addSubview:_usernameLabel];
        [self.contentView addSubview:_downLoadButton];
        
    }
    return self;
}
-(void)setDetailModel:(PKRadioDetailModel *)detailModel
{
    _detailModel=detailModel;
    _titleLabel.text=detailModel.title;
    _usernameLabel.text=  [@"by:" stringByAppendingString:detailModel.playInfo.userinfo.uname] ;
    if (detailModel.isSelected) {
        _leftView.backgroundColor=[UIColor greenColor];
        
    }
    else
    {
        _leftView.backgroundColor=[UIColor whiteColor];
    }
}
- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
